package yuhuibear.poat.object.mapEntity;

import yuhuibear.poat.macro.MacroDefine;
import yuhuibear.poat.object.bean.BeanStruct;

public class MacroTask extends SqlTask {

	private static int macroCnt = 0;

	public MacroTask(MacroDefine macro, BeanStruct bean) {
		init(macro.name, MapEntityTask.Type.Macro, macro.getDefPlace(), bean, macro.sql);
		MacroTask.macroCnt++;
		SqlTask.register();
		refs.addAll(macro.getDepends());
	}

	public static int macroCount() {
		return macroCnt;
	}

	public void done() {
		done = true;
		MacroTask.macroCnt--;
		SqlTask.unRegister();
	}
}
